import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/order_create_entity.dart';

OrderCreateEntity $OrderCreateEntityFromJson(Map<String, dynamic> json) {
  final OrderCreateEntity orderCreateEntity = OrderCreateEntity();
  final String? orderId = jsonConvert.convert<String>(json['order_id']);
  if (orderId != null) {
    orderCreateEntity.orderId = orderId;
  }
  final String? payStr = jsonConvert.convert<String>(json['pay_str']);
  if (payStr != null) {
    orderCreateEntity.payStr = payStr;
  }
  final String? payReferer = jsonConvert.convert<String>(json['pay_referer']);
  if (payReferer != null) {
    orderCreateEntity.payReferer = payReferer;
  }
  return orderCreateEntity;
}

Map<String, dynamic> $OrderCreateEntityToJson(OrderCreateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['order_id'] = entity.orderId;
  data['pay_str'] = entity.payStr;
  data['pay_referer'] = entity.payReferer;
  return data;
}

extension OrderCreateEntityExtension on OrderCreateEntity {
  OrderCreateEntity copyWith({
    String? orderId,
    String? payStr,
    String? payReferer,
  }) {
    return OrderCreateEntity()
      ..orderId = orderId ?? this.orderId
      ..payStr = payStr ?? this.payStr
      ..payReferer = payReferer ?? this.payReferer;
  }
}